<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>类中的方法this指向</title>
</head>
<body>
    
    <script type="text/javascript">
        /*
        * @Description: B站 react视频 15 没看懂
        * @Author: hkk
        * @Date: 2022/12/06 14:40:51
        */
        class Person{
            constructor(name,age){
                this.name = name
                this.age = age
            }
            speak(){
                console.log(this);
            }
        }
        let p1 = new Person('张三',15)
        p1.speak()
    </script>


</body>
</html>